package com.youen.controller;

import com.youen.entity.User;
import com.youen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Dell on 2018/9/7.
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/add")
    public String addUserView(){
        return "user/addUser";
    }

    @RequestMapping("/addUser")
    public @ResponseBody String addUser(User user){
        return userService.addUser(user);
    }
}
